/*
 * @(#)UserDaoImpl.java 2013-4-10 ����01:35:11 Order
 */
package com.dingtalk.dingbotmgr.dao.impl;

import java.util.List;

import com.dingtalk.dingbotmgr.dao.ProjectDao;
import com.dingtalk.dingbotmgr.model.Company;
import com.dingtalk.dingbotmgr.model.Project;
import org.springframework.stereotype.Component;

/**
 * UserDaoImpl
 *
 * @author wang
 * @version 1.0
 */
@Component("projectDao")
public class ProjectDaoImpl extends BaseDaoImpl<Project> implements ProjectDao {

    @Override
    public List<Project> listByCompany(Company company) {
        return list(Project.class, "from Project p where "
                + "p.shejiCompany = ? or p.shigongCompany = ? or p.jianliCompany = ? "
                + "or p.shenjiCompany = ? or p.zhaobiaoCompany = ?",
            new Object[] {company, company, company, company, company});
    }
}
